package com.singzi.leetcode.N800;

public class T0717 {
}
class Solution0717 {
    public boolean isOneBitCharacter(int[] bits) {

        int n = bits.length;
        if(n==1) return true;
        boolean flag = false;
        if(bits[n-2] == 0) return true;
        for(int i = n-2;i >= 0;i--){
            if(bits[i] == 0){
                n = n - i - 2;
                flag = true;
                break;
            }
        }
        if(!flag) n = n+1;


        return n%2==0;

    }
}